<% #endcoding:utf-8 %>
<%=render partial: "shared/path_nav",locals:{:@paths=>[{name:'首页',url:'/'},{name:'所有需求',url:'/demands'},{name:@demand.projects}]}%>

<div class="panel">
  <div class="panel-heading">
    <%=render partial: "status",:locals => {:status=>@demand.status}%>
    <h3 class="demand-top">需求详情</h3>
  </div>
  <div class="panel-body">
    <ul class="media-list">
      <li class="media">
        <div class="media-left">
          <a href='/usercard/<%=@demand.user_id%>'><%=avatar User.find(@demand.user_id),'media-object img-ground img-normal'%></a>
        </div>
        <div class="media-body">
          <h4 class="media-heading"><%=@demand.projects%></h4>
          <%=@demand.description.html_safe%>
        </div>
      </li>
    </ul>
    <p class="timeago text-right">
        <a href='/usercard/<%=@demand.user_id%>'><%=getname @demand.user_id%></a>
       · 发布于 · <%=time_ago_in_words(@demand.created_at) %> 以前
    </p>
  </div>
</div>

<div class="panel">
  <div class="panel-heading">
    <h3 class="demand-top">报价 (<%=@offers.count%>)</h3>
  </div>
  <div class="panel-body">
    <div class="offer-list">
      <%if @offers.any?%>
          <%=render @offers%>
          <%=will_paginate @offers%>
      <%else%>
          <%=render partial: "shared/no_content"%>
      <%end%>
      <%if session[:user_id].nil?%>
      <%=link_to "登陆",login_path%> 后可报价
          <%else%>
      <%if !ismydemand?(@demand) && @demand.status<2 && !hasOffered?(@demand.id)%><p class="text-center"><%=link_to "报价",new_demand_offer_path(@demand),:class=>"btn btn-success"%></p><%end%>
    <%end%>
          </div>
  </div>
  <div class="panel-footer">

  </div>
</div>



